#!/bin/tcsh

# Used by Jenkins to build and test the installation automatically on various platforms. 
# -e  The shell exits if any invoked command terminates abnormally or yields a non-zero exit status.

echo "Starting with aquaBuildAndTest.csh from $cwd"

# Do use the absolute path.
cd $0:h
echo "DEBUG: Now in cwd: $cwd"
echo "DEBUG: PATH       1: $PATH"

# AQUA ROOT will end up in aquaroot from aqsetup
setenv AQUAROOT $cwd
# Needed on systems that are case sensitive to this. In aqsetup the lowercase is used.
setenv aquaroot $AQUAROOT
source $AQUAROOT/aqsetup
#aquad

set PATH = ( $AQUAROOT/extras $AQUAROOT/bin $PATH )
echo "DEBUG: PATH       2  : $PATH"
echo "DEBUG: AQUAROOT   2  : $AQUAROOT"

cd src
make -j clean
make -j all 
make -j test

echo "Done with aquaBuildAndTest.csh"
